package legoproject.Behaviors;

import java.util.ArrayList;
import legoproject.*;

public class HomingLineAndLight implements Behavior{


    public boolean condition() {
        int value = GarbageCollector.lightSensor.readValue();
        GarbageCollector.reporter.updateStat(1, value);
        if(value < GarbageCollector.blackThreshold && GarbageCollector.garbageInGrab){
            return true;
        }
        else{
            return false;
        }
        
    }

    public ArrayList behave() {
        ArrayList result = new ArrayList();
        result.add(new Instruction(InstructionType.FINDHOME, 0, 0 ));
        result.add(new Instruction(InstructionType.FOLLOWLINE, 0, 0 ));
        return result;

    }


}
